<?php

namespace app\index\model\traits;


trait ModelHasTime
{

	public function getKnowPhoneAttr($value)
	{
		return decrypts($value,config('sha256'));
	}


	public function getKnowEmailAttr($value)
	{
		return decrypts($value,config('sha256'));
	}

	public function getPhoneAttr($value)
	{
		return decrypts($value,config('sha256'));
	}


	public function getEmailAttr($value)
	{
		return decrypts($value,config('sha256'));
	}


	public function getKnowNicknameAttr($value)
	{
		if (isBase64($value)){
			return decrypts($value,config('sha256'));
		}else {
			return $value;
		}
	}

	public function getNicknameAttr($value)
	{
		if (isBase64($value)){
			return decrypts($value,config('sha256'));
		}else {
			return $value;
		}
	}

	public function setKnowPhoneAttr($value)
	{
		return encrypts($value,config('sha256'));
	}

	public function setKnowEmailAttr($value)
	{
		return encrypts($value,config('sha256'));
	}


	public function setKnowNicknameAttr($value)
	{
		if (checkNicknameRight($value)){
			return encrypts($value,config('sha256'));
		}else {
			return $value;
		}
	}

}